import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/home",
    component: () => import("@/views/Layout"),
    children:[]
    // children: [
    //   {
    //     path: "home",
    //     name: "home",
    //     label: "首页",
    //     icon: "s-home",
    //     show: true,
    //     component: () => import("@/views/home")
    //   },
    //   {
    //     label: "权限管理",
    //     icon: "s-tools",
    //     name: "permission",
    //     path: "permission",
    //     show: true,
    //     component: () => import("@/views/permission"),
    //     children: [
    //       {
    //         path: "/permission/user",
    //         name: "user",
    //         label: "用户",
    //         icon: "user",
    //         show: true,
    //         component: () => import("@/views/permission/user/index.vue")
    //       },
    //       {
    //         path: "/role",
    //         name: "role",
    //         label: "角色",
    //         icon: "platform-eleme",
    //         show: true,
    //         component: () => import("@/views/permission/role")
    //       },
    //       {
    //         path: "/menu",
    //         name: "menu",
    //         label: "菜单",
    //         icon: "s-flag",
    //         show: true,
    //         component: () => import("@/views/permission/menu")
    //       }
    //     ]
    //   }
    // ]
  },
  {
    path: "/login",
    component: () => import("@/views/login")
  }
];

export const defaultRoutes = [
  {
    path: "/",
    redirect: "/home",
    component: () => import("@/views/Layout"),
    children: []
  },
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/login")
  }
];

const router = new VueRouter({
  routes
});

export default router;
